{% extends "admin_base.html" %}
{% block bodycontent %}

{% if create_org %}
<h1>Create An Organization</h1>
<p>There are four requirements for an organization to participate in the system:</p>
<ol>
    <li>The organization must have a physical presence in the disaster area.</li>
    <li>The organization must either perform home assessments and/or perform gutting, mucking-out, debris removal, mold abatement, or rebuilding.</li>
    <li>The organization must be reputable. This generally means a member of National VOAD, a state VOAD, a County VOAD/COAD, a local government agency, or come recommended by a VOAD member or government agency.</li>
    <li>The organization must agree to adhere to the <a href="#">Terms of Service</a>.</li>
    <li>Each volunteer using the system must watch the <a href="#">Training Video</a>.</li>
</ol>
<p><strong>Filling out this application carefully, correctly, and completely will save you hours and save your volunteers dozens or hundreds of hours in productivity (we promise).</strong></p>

<form method="POST" action="/admin">
{% if errors %}
<section id="errors">
  <header>The submission had errors</header>
  <article>
    <ul>
    {% for k in errors %}
      <li class="error">
        {% for e in errors[k] %}
          {{k}}: {{e}}
        {% endfor %}
      </li>
    {% endfor %}
    </ul>
  <article>
</section>
{% endif %}
<div name="select_div" id="select_div">
{% if events_list %}
<h1>Choose an incident: </h1>

<select name="choose_event">
{% for result in events_list %}
<option value="{{result.key().id()}}">{{result.name}}</option>
{% endfor %}
</select>
{% endif %}
<h2>Should organization be immediately active?</h2>
<input type="radio" id="is_active" name="is_active" value="1"><label for="is_active">Active</label>

<h2>Organization Information</h2>
  <div>{{ form.name.label }}: {{ form.name }}</div>
  <div>{{ form.email.label }}: {{ form.email }}</div>
  <div>{{ form.phone.label }}: {{ form.phone }}</div>
  <div>{{ form.address.label }}: {{ form.address }}</div>
  <div>{{ form.city.label }}: {{ form.city }}</div>
  <div>{{ form.state.label }}: {{ form.state }}</div>
  <div>{{ form.zip_code.label }}: {{ form.zip_code }}</div>
  <div>{{ form.twitter.label }}: {{ form.twitter }}</div>
  <div>{{ form.facebook.label }}: {{ form.facebook }}</div>
  <div>{{ form.url.label }}: {{ form.url }}</div>

    
  {% if form.physical_presence %}
  <tr>
    <td class="question">{{ form.physical_presence.label }}</td>
    <td class="answer">{{ form.physical_presence }}</td>
  </tr>
  <br/>
  {% endif %}
  <div>{{ form.work_area.label }}: {{ form.work_area }}</div>
  <div>{{ form.number_volunteers.label }}: {{ form.number_volunteers }}</div>
  {% if form.voad_member %}
  <tr>
    <td>{{ form.voad_member.label }}</td>
    <td>{{ form.voad_member }}</td>
  </tr>
  <br/>
  {% endif %}
  <div>{{ form.voad_member_url.label }}: {{ form.voad_member_url }}</div>
  <div>{{ form.voad_referral.label }}: {{ form.voad_referral }}</div>

<h3>Operations</h3>
<p>Please take the time to carefully and correctly indicate the work your organization will <strong>normally perform</strong> during this Incident.</p><p>You will save yourself, staff, volunteers, and other volunteers <em>hundreds</em> of hours if you fill this form out <em>accurately</em>.</p><p>It will significantly un-clutter the map, and ensure that work orders are not lost or forgotten.</p>

  {# phase fields #}
  {% for phase_radio_field in form.get_phase_fields() %}
    <tr>
      <td>{{ phase_radio_field.label }}</td>
      <td>{{ phase_radio_field }}</td>
    </tr>
    <br/>
  {% endfor %}
 
  <br/>
  <p><strong>Auto generated password = {{auto_password}}</strong></p>
  <p><strong>Please keep for your records</strong></p>
  <input type=hidden name=password value={{auto_password}}>

  <input type=hidden name=create_org value="true">

  <br/>
<input type=submit value="Submit request">

</form>
{% endif %}

{% endblock %}
